uniform sampler2D tex0;
uniform float elapsed_time;

vec2 wavyCoords(in float time, in vec2 coords)
{
	//vec2 coords;	
	//coords.y = _coords.y + (sin(time)*0.01);
	//coords.x = _coords.x + (cos(time)*0.01);

	vec2 coords2;

	coords2.y = coords.y + (sin((time*0.05+coords.x)*10.0)*0.01);
	coords2.x = coords.x + (sin((time*0.05+coords.y)*10.0)*0.01);

	return coords2;
}

void main(void)
{
	// transform our texture coordinates, by applying our
	// wavy effect.
	vec2 st = wavyCoords(elapsed_time, gl_TexCoord[0].st);

	// retrieve the color at our new coordinates
	vec4 color	 = texture2D(tex0, st);
	
	gl_FragColor = color;
}